<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="java.util.*"%>
<%
	String contextpath = request.getContextPath();
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
	function pic_upload_success(file, data) {
		var json = $.parseJSON(data)
		$(this).bjuiajax('ajaxDone', json)
		if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
			$('#j_custom_pic1').val(json.navTabId).trigger('validate')
			$(this).navtab('reloadForm', true)
		}
	}
</script>

<div class="bjui-pageHeader">
	<form id="pagerForm" data-toggle="ajaxsearch"
		action="http://localhost:8050/zhangzhi/query.do" method="post">
		<input type="hidden" name="pageSize" value="${pageSize}"> <input
			type="hidden" name="pageCurrent" value="${pageCurrent}">
		<div class="bjui-searchBar">
			<label></label><input type="text" id="customNo" value="" name="code"
				class="form-control" size="10">&nbsp; <label
				for="j_custom_birthday" class="doc_datepicker"></label> <input
				type="text" class="doc_datepicker" data-toggle="datepicker"
				size="12"> <label></label><input type="text" value=""
				name="name" class="form-control" size="8">&nbsp;
			<button type="button" class="showMoreSearch" data-toggle="moresearch"
				data-name="custom2">
				<i class="fa fa-angle-double-down"></i>
			</button>
			<button type="submit" class="btn-default" data-icon="search">查询</button>
			<a class="btn btn-orange" href="javascript:;"
				data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询</a>
			<button type="button" class="btn-default"
				onclick="window.location.href='<%=contextpath%>/excel/temp.xls'">下载出入库模板</button>
			&nbsp;&nbsp;&nbsp;&nbsp;
			<div class="pull-right">
				<button type="button" class="btn-blue"
					data-url="ajaxDone2.html?id={#bjui-selected}" data-toggle="doajax"
					data-confirm-msg="确定要删除选中项吗？" data-icon="remove"
					title="可以在控制台(network)查看被删除ID">删除选中行</button>
				&nbsp;
				<div class="btn-group">
					<button type="button" class="btn-default dropdown-toggle"
						data-toggle="dropdown" data-icon="copy">
						复选框-批量操作<span class="caret"></span>
					</button>
					<ul class="dropdown-menu right" role="menu">
						<li><a href="book1.xlsx" data-toggle="doexport"
							data-confirm-msg="确定要导出信息吗？">导出<span style="color: green;">全部</span></a></li>
						<li><a href="book1.xlsx" data-toggle="doexportchecked"
							data-confirm-msg="确定要导出选中项吗？" data-idname="expids"
							data-group="ids">导出<span style="color: red;">选中</span></a></li>
						<li class="divider"></li>
						<li><a href="ajaxDone2.html" data-toggle="doajaxchecked"
							data-confirm-msg="确定要删除选中项吗？" data-idname="delids"
							data-group="ids">删除选中</a></li>
					</ul>
				</div>
			</div>
		</div>
		<div class="bjui-moreSearch">
			<label>职业<input type="text" value="" name="profession"
				size="15" /> </select> <label>&nbsp;手机号:</label> <input type="text" value=""
				name="mobile" size="10">&nbsp;&nbsp;&nbsp;&nbsp;
				<div style="display: inline-block; vertical-align: middle;">
					<div id="j_custom_pic_up1" data-toggle="upload"
						data-uploader="http://localhost:8050/zhangzhi/importExcel.do"
						data-file-size-limit="1024*2" data-file-type-exts="*.xls"
						data-multi="false" data-on-upload-success="pic_upload_success"
						data-icon="cloud-upload" data-preview-img="false">
						<label>导入库单:</label>
					</div>
					<input type="hidden" name="custom.pic1" value="" id="j_custom_pic1"
						data-target="#j_custom_pic_up1 .bjui-upload-select-file">
					<span id="j_custom_span_pic1"></span>
				</div>
		</div>
	</form>
</div>
<div class="bjui-pageContent">
	<table class="table table-bordered table-hover table-striped table-top"
		data-layout-h="0" data-selected-multi="false">
		<thead>
			<tr>
				<th width="26"><input type="checkbox" class="checkboxCtrl"
					data-group="ids" data-toggle="icheck"></th>
				<th data-order-field="date">日期</th>
				<th data-order-field="companyname">单位名称</th>
				<th data-order-field="measurement">品名</th>
				<th data-order-field="size">规格</th>
				<th data-order-field="type">入</th>
				<th data-order-field="type">出</th>
				<th data-order-field="leave">剩余</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${results}" var="data">
				<tr data-id="${data.id}">
					<td><input type="checkbox" name="ids" data-toggle="icheck"
						value="${data.id}"></td>
					<td>${data.accountdate}</td>
					<td>${data.companyname}</td>
					<td>${data.measurement}</td>
					<td>${data.size}</td>
					<c:choose>
						<c:when test="${data.type==1}">
							<td>${data.height}</td>
						</c:when>
						<c:otherwise>
							<td></td>
						</c:otherwise>
					</c:choose>
					<c:choose>
						<c:when test="${data.type==-1}">
							<td>${data.height}</td>
						</c:when>
						<c:otherwise>
							<td></td>
						</c:otherwise>
					</c:choose>
					<th></th>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="bjui-pageFooter">
		<div class="pages">
			<span>每页&nbsp;</span>
			<div class="selectPagesize">
				<select data-toggle="selectpicker"
					data-toggle-change="changepagesize">
					<option value="30"
						<c:if test="${pageSize==30}">selected="selected"</c:if>>30</option>
					<option value="60"
						<c:if test="${pageSize==60}">selected="selected"</c:if>>60</option>
					<option value="120"
						<c:if test="${pageSize==120}">selected="selected"</c:if>>120</option>
					<option value="150"
						<c:if test="${pageSize==150}">selected="selected"</c:if>>150</option>
				</select>
			</div>
			<span>&nbsp;条，共 ${totalNum} 条</span>
		</div>
		<div class="pagination-box" data-toggle="pagination"
			data-total="${totalNum}" data-page-size="${pageSize}"
			data-page-current="${pageCurrent}"></div>
	</div>
</div>
